import request from '@/utils/request'
import {SysUserQuery, SysUserParams} from "@/common/interface/user.ts";

// 查询系统用户列表
export function listUser(query: SysUserQuery) {
    return request({
        url: '/system/user/list',
        method: 'get',
        params: query
    })
}

// 查询系统用户详细
export function getUser(id: number) {
    return request({
        url: '/system/user/' + id,
        method: 'get'
    })
}

// 新增系统用户
export function addUser(data: SysUserParams) {
    return request({
        url: '/system/user',
        method: 'post',
        data: data
    })
}

// 修改系统用户
export function updateUser(data: SysUserParams) {
    return request({
        url: '/system/user',
        method: 'put',
        data: data
    })
}

// 删除系统用户
export function delUser(id: number[]) {
    return request({
        url: '/system/user/' + id,
        method: 'delete'
    })
}
